package com.tm.d3_exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;

/**
 * 2024/6/2 Cjj 异常的处理
 */
public class Exceptiontest3 {
    public static void main(String[] args) {
        try {
            test1();
        } catch (FileNotFoundException e) {
            System.out.println("您要找的文件不存在");
           e.printStackTrace();
        } catch (ParseException e) {
            System.out.println("您要解析的时间有问题");
          e.printStackTrace();
        }
    }

    public static void test1() throws FileNotFoundException, ParseException {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date d=format.parse("2024-6-2");
        System.out.println(d);
        test2();
    }

    public static void test2() throws FileNotFoundException {
        InputStream inputStream = new FileInputStream("D:\\Fialshell-命令图片\\1.png");
    }

}
